﻿using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;

namespace Plot.Primitives
{
    internal abstract class PShape : IEnumerable<PShape>
    {
        public Point StartPoint { get; set; }
        public Point PivotPoint { get; set; }

        public double Angle { get; set; }

        public PShape(double x, double y, double angle)
        {
            Angle = angle;
            PivotPoint = StartPoint = new Point(x,y);
        }

        public virtual IEnumerator<PShape> GetEnumerator()
        {
            return new ReadOnlyCollection<PShape>(new[] {this}).GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}